public class Demo13 {
    public static Object obj1 = new Object();
    public static Object obj2 = new Object();
    public static Object obj3 = new Object();
    public static void main(String[] args) {
        Thread t1 = new Thread(()->{
            System.out.println("C");
        });
        Thread t2 = new Thread(()->{
            try {
                t1.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("B");
        });
        Thread t3 = new Thread(()->{
            try {
                t2.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("A");
        });
        t3.start();
        t2.start();
        t1.start();
    }

}
